<template>
  <el-button v-for="item in socialConfigs" circle :title="item.sourceName" @click="doSocialLogin(item.sourceType)">
    <svg-icon :icon-class="item.sourceIcon" />
  </el-button>
</template>

<script setup>
import {binding} from "@/api/social/auth.js";

const props = defineProps({
  socialConfigs: {
    type: Array,
    default: () => [],
  }
});

function doSocialLogin(source) {
  binding(source).then(res => {
    top.location.href = res.msg;
  });
}
</script>
